package com.api.shopapi.mapper;

import com.api.shopapi.entity.DeviceYjgatewayItem;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface DeviceYjgatewayItemMapper {

    @Insert("insert into device_yjgateway_item (DeviceYjgatewayItemCode,DeviceYjgatewayCode,Zone,DeviceName,DeviceType,Model,DeviceId) values " +
            "(#{deviceYjgatewayItem.DeviceYjgatewayItemCode},#{deviceYjgatewayItem.DeviceYjgatewayCode},#{deviceYjgatewayItem.Zone}," +
            "#{deviceYjgatewayItem.DeviceName},#{deviceYjgatewayItem.DeviceType},#{deviceYjgatewayItem.Model},#{deviceYjgatewayItem.DeviceId})")
    int insert(@Param("deviceYjgatewayItem") DeviceYjgatewayItem deviceYjgatewayItem);

    @Delete("delete from device_yjgateway_item where DeviceYjgatewayItemCode=#{deviceYjgatewayItemCode}")
    int delete(@Param("deviceYjgatewayItemCode") String deviceYjgatewayItemCode);

    @Select("select * from device_yjgateway_item where DeviceYjgatewayCode=#{deviceYjgatewayCode}")
    List<DeviceYjgatewayItem> getListByDeviceYjgatewayCode(@Param("deviceYjgatewayCode") String deviceYjgatewayCode);


}
